//
//  CCMMineViewCell.swift
//  CCMoney_swift
//
//  Created by JKHuang on 2018/11/27.
//  Copyright © 2018 JKHuang. All rights reserved.
//

import UIKit

class CCMMineViewCell: UITableViewCell {
    
    lazy var arrowButton:UIButton = {
        let button = UIButton()
        button.setImage(UIImage(named: "箭头_icon"), for: .normal)
        return button
    }()
    
    lazy var titleLable:UILabel = {
        let label = UILabel()
        label.textColor = UIColor.white
        label.font = UIFont.systemFont(ofSize: 14)
        return label
    }()
    
    lazy var contentLable:UILabel = {
        let label = UILabel()
        label.textColor = UIColor.white
        label.font = UIFont.systemFont(ofSize: 12)
        label.isHidden = true
        return label
    }()
    
    lazy var lineView:UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.hex(0xD9D9D9)
        return view
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.backgroundColor = UIColor.hex(0x2D3554)
        setUI()
    }

    required init?(coder aDecoder: NSCoder) {
       fatalError("init(coder:) has not been implemented")
    }
}

extension CCMMineViewCell{
    
    fileprivate func setUI(){
        
        self.contentView.addSubview(self.arrowButton)
        self.contentView.addSubview(self.titleLable)
        self.contentView.addSubview(self.lineView)
        self.contentView.addSubview(self.contentLable)
        
        
        self.titleLable.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.contentView)
            make.leading.equalTo(self.contentView).offset(15)
        }
        
        self.arrowButton.snp.makeConstraints { (make) in
            make.trailing.equalTo(self.contentView).offset(-16)
            make.centerY.equalTo(self.contentView)
        }
        
        self.lineView.snp.makeConstraints { (make) in
            make.bottom.equalTo(self.contentView)
            make.leading.equalTo(self.contentView).offset(15)
            make.trailing.equalTo(self.contentView)
            make.height.equalTo(0.8)
        }
        
        self.contentLable.snp.makeConstraints { (make) in
            make.trailing.equalTo(self.contentView).offset(-35)
            make.centerY.equalTo(self.contentView)
        }
        
    }
}
